<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>投诉与建议</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="${ctx}/adminlte/bootstrap/css/bootstrap.min.css">
    <link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${ctx}/adminlte/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="${ctx}/adminlte/dist/css/skins/_all-skins.min.css">

    <!-- iCheck -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/iCheck/flat/blue.css">

    <!-- Morris chart -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/morris/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/datepicker/datepicker3.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

    <link rel="stylesheet" href="${ctx}/adminlte/plugins/bootstrap-fileinput/fileinput.min.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/r29/html5.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini">
<!-- Site wrapper -->
<div class=""><!-- Content Wrapper. Contains page content -->
    <div class="" style="margin-left: 0px">
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <img src="${ctx}/uploadfile/pic/logo.jpg" width="180px" height="180px" class="img-responsive center-block">
                        <form id="edit_form" action="${ctx}/complaintadvice/save" method="post" role="form" enctype="multipart/form-data">
                            <legend>投诉与建议</legend>
                            <input type="hidden" name="id" id="id" value="${complaintAdvice.id!}">
                            <input type="hidden" name="status" id="status" value="0">
                            <div class="form-group">
                                <label for="adv_type">类型</label>
                                <select class="form-control" id="adv_type" name="adv_type" placeholder="类型" value="${complaintAdvice.adv_type!}">
                                    <option value = "0" <#if complaintAdvice.adv_type??&&complaintAdvice.adv_type==0>selected="selected"</#if>>投诉举报</option>
                                    <option value = "1" <#if complaintAdvice.adv_type??&&complaintAdvice.adv_type==1>selected="selected"</#if>>意见建议</option>
                                    <option value = "2" <#if complaintAdvice.adv_type??&&complaintAdvice.adv_type==2>selected="selected"</#if>>其他</option>
                                </select>    </div>

                            <div class="form-group">
                                <label for="content">问题</label>
                                <textarea id="content" name="content" class="form-control" rows="5" >${complaintAdvice.content!}</textarea>
                            </div>
                            <div class="form-group" id="fileGroup">
                                <label for="file">照片</label>
                                <input id="file" type="file" name="file"  class="file-loading">
                                <input style="display:none" id="file2" type="file" name="file"  class="file-loading" >
                                <input style="display:none" id="file3" type="file" name="file"  class="file-loading" >
                            </div>
                            <div class="form-group">
                                <label for="advice">建议</label>
                                <textarea id="advice" name="advice" class="form-control" rows="5" >${complaintAdvice.advice!}</textarea>
                            </div>
                            <div class="form-group">
                                <label for="name">姓名</label>
                                <input type="text" class="form-control" id="name" name="name" placeholder="姓名" value="${complaintAdvice.name!}" >
                            </div>
                            <div class="form-group">
                                <label for="phone">电话</label>
                                <input type="text" class="form-control" id="phone" name="phone" placeholder="电话" value="${complaintAdvice.phone!}" >
                            </div>
                            <!--<div class="form-group">-->
                                <!--<label for="wx_user_id">微信号</label>-->
                                <input type="hidden" class="form-control" id="wx_user_id" name="wx_user_id" placeholder="微信号" value="${complaintAdvice.wx_user_id!}">
                            <!--</div>-->
                            <button type="submit" class="btn btn-primary">提交</button><button type="submit" class="btn btn-cancle" onclick="javascript :history.back(-1);">返回</button>
                        </form>
                    </div>
                </div>
            </div>
        </section>

    </div><!-- /.content-wrapper -->

    <footer class="main-footer no-print" style="margin-left: 0px">
        <div class="pull-right hidden-xs">
            <b>Version</b> 1.1.0
        </div>
        <strong>Copyright &copy; 2017 <a href="#">汇智智能</a>.</strong> All rights reserved.
    </footer>



    <script src="${ctx}/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <script src="${ctx}/adminlte/plugins/jQuery/jquery.validate.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="${ctx}/adminlte/bootstrap/js/bootstrap.min.js"></script>
    <!-- SlimScroll -->
    <script src="${ctx}/adminlte/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="${ctx}/adminlte/plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="${ctx}/adminlte/dist/js/app.min.js"></script>
    <script type="text/javascript" src="${ctx}/adminlte/plugins/bootstrap-fileinput/fileinput.min.js"></script>
    <script type="text/javascript" src="${ctx}/adminlte/plugins/bootstrap-fileinput/zh.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#file").fileinput({
                language: 'zh',
                //uploadUrl: '${ctx}/complaintadvice/uploadPic', // you must set a valid URL here else you will get an error
                allowedFileExtensions: ['jpg', 'png', 'gif'],
                browseClass: "btn btn-primary btn-block",
                showCaption: false,
                showRemove: false,
                showUpload: false,
                maxFileSize: 5000,
                maxFilesNum: 10
            });
            $('#file2').on('filecleared', function(event) {
                console.log("filecleared");
                $('#file').fileinput('enable');
                $('#file2').fileinput('destroy');
                $('#file2').css("display","none");
            });
            $('#file').on('fileimagesloaded', function(event) {
                console.log("fileimagesloaded");
               // $('#file').fileinput('disable');
                $("#file2").fileinput({
                    language: 'zh',
                    //uploadUrl: '${ctx}/complaintadvice/uploadPic', // you must set a valid URL here else you will get an error
                    allowedFileExtensions: ['jpg', 'png', 'gif'],
                    browseClass: "btn btn-primary btn-block",
                    showCaption: false,
                    showRemove: false,
                    showUpload: false,
                    maxFileSize: 5000,
                    maxFilesNum: 10
                });
                $('#file2').css("display","inline");
            });
            $('#file3').on('filecleared', function(event) {
                console.log("filecleared");
                $('#file2').fileinput('enable');
                $('#file3').fileinput('destroy');
                $('#file3').css("display","none");
            });
            $('#file2').on('fileimagesloaded', function(event) {
                console.log("fileimagesloaded");
                //$('#file2').fileinput('disable');
                $("#file3").fileinput({
                    language: 'zh',
                    //uploadUrl: '${ctx}/complaintadvice/uploadPic', // you must set a valid URL here else you will get an error
                    allowedFileExtensions: ['jpg', 'png', 'gif'],
                    browseClass: "btn btn-primary btn-block",
                    showCaption: false,
                    showRemove: false,
                    showUpload: false,
                    maxFileSize: 5000,
                    maxFilesNum: 10
                });
                $('#file3').css("display","inline");
            });
        });



        $.extend($.validator.messages, {
            required:"此处不能为空"
        });
        jQuery.validator.addMethod("isPhone", function(value, element) {
            var tel = /^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/;
            return this.optional(element) || (tel.test(value));
        }, "请正确填写您的电话号码！");

        $("#edit_form").validate({
            rules: {
                phone:{
                    isPhone: true,
                    required:true
                },
                name:{
                    required:true
                },
                content:{
                    required:true
                },
                advice:{
                    required:true
                }

            },
            message: {
                phone:{
                    isPhone: "请正确填写您的电话号码",
                }
            }
        });
    </script>
    <style type="text/css">
        .error{
            color: #ff0000;
        }
    </style>
</div>
</body>
</html>